package com.ztom.core.io

import java.io.FileNotFoundException
import java.io.InputStream

/**
 * @author ZhangTao
 */
class ClassPathResource(private val path: String) : Resource {

    override fun getInputStream(): InputStream {
        return this::class.java.classLoader.getResourceAsStream(path)
            ?: throw FileNotFoundException("$path cannot be opened because it does not exist")
    }
}